diff --git a/examples/06-bump/bump.cpp b/examples/06-bump/bump.cpp index 2f2991619..9e9f214a4 100644 --- a/examples/06-bump/bump.cpp +++ b/examples/06-bump/bump.cpp @@ -142,8 +142,8 @@ public: m_ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) ); // Create texture sampler uniforms. - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); - s_texNormal = bgfx::createUniform("s_texNormal", bgfx::UniformType::Int1); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); + s_texNormal = bgfx::createUniform("s_texNormal", bgfx::UniformType::Sampler); m_numLights = 4; u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Vec4, m_numLights); diff --git a/examples/08-update/update.cpp b/examples/08-update/update.cpp index 0eb0c53ca..fdf2ff859 100644 --- a/examples/08-update/update.cpp +++ b/examples/08-update/update.cpp @@ -250,8 +250,8 @@ public: } // Create texture sampler uniforms. - s_texCube = bgfx::createUniform("s_texCube", bgfx::UniformType::Int1); - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); + s_texCube = bgfx::createUniform("s_texCube", bgfx::UniformType::Sampler); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); // Create time uniform. u_time = bgfx::createUniform("u_time", bgfx::UniformType::Vec4); diff --git a/examples/09-hdr/hdr.cpp b/examples/09-hdr/hdr.cpp index fb3a266da..331149fad 100644 --- a/examples/09-hdr/hdr.cpp +++ b/examples/09-hdr/hdr.cpp @@ -183,10 +183,10 @@ public: m_meshProgram = loadProgram("vs_hdr_mesh", "fs_hdr_mesh"); m_tonemapProgram = loadProgram("vs_hdr_tonemap", "fs_hdr_tonemap"); - s_texCube = bgfx::createUniform("s_texCube", bgfx::UniformType::Int1); - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); - s_texLum = bgfx::createUniform("s_texLum", bgfx::UniformType::Int1); - s_texBlur = bgfx::createUniform("s_texBlur", bgfx::UniformType::Int1); + s_texCube = bgfx::createUniform("s_texCube", bgfx::UniformType::Sampler); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); + s_texLum = bgfx::createUniform("s_texLum", bgfx::UniformType::Sampler); + s_texBlur = bgfx::createUniform("s_texBlur", bgfx::UniformType::Sampler); u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4); u_tonemap = bgfx::createUniform("u_tonemap", bgfx::UniformType::Vec4); u_offset = bgfx::createUniform("u_offset", bgfx::UniformType::Vec4, 16); diff --git a/examples/12-lod/lod.cpp b/examples/12-lod/lod.cpp index 130826c74..7ecbb836a 100644 --- a/examples/12-lod/lod.cpp +++ b/examples/12-lod/lod.cpp @@ -62,8 +62,8 @@ public: , 0 ); - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); - s_texStipple = bgfx::createUniform("s_texStipple", bgfx::UniformType::Int1); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); + s_texStipple = bgfx::createUniform("s_texStipple", bgfx::UniformType::Sampler); u_stipple = bgfx::createUniform("u_stipple", bgfx::UniformType::Vec4); m_program = loadProgram("vs_tree", "fs_tree"); diff --git a/examples/13-stencil/stencil.cpp b/examples/13-stencil/stencil.cpp index 87edeb849..460aac4fb 100644 --- a/examples/13-stencil/stencil.cpp +++ b/examples/13-stencil/stencil.cpp @@ -819,7 +819,7 @@ public: s_uniforms.init(); - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); m_programTextureLighting = loadProgram("vs_stencil_texture_lighting", "fs_stencil_texture_lighting"); m_programColorLighting = loadProgram("vs_stencil_color_lighting", "fs_stencil_color_lighting" ); diff --git a/examples/14-shadowvolumes/shadowvolumes.cpp b/examples/14-shadowvolumes/shadowvolumes.cpp index afe408c5e..dcdbae34a 100644 --- a/examples/14-shadowvolumes/shadowvolumes.cpp +++ b/examples/14-shadowvolumes/shadowvolumes.cpp @@ -1896,8 +1896,8 @@ public: s_stencilFb = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true); - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); - s_texStencil = bgfx::createUniform("s_texStencil", bgfx::UniformType::Int1); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); + s_texStencil = bgfx::createUniform("s_texStencil", bgfx::UniformType::Sampler); m_programTextureLighting = loadProgram("vs_shadowvolume_texture_lighting", "fs_shadowvolume_texture_lighting"); m_programColorLighting = loadProgram("vs_shadowvolume_color_lighting", "fs_shadowvolume_color_lighting" ); diff --git a/examples/15-shadowmaps-simple/shadowmaps_simple.cpp b/examples/15-shadowmaps-simple/shadowmaps_simple.cpp index b42b4a6f8..05befef3c 100644 --- a/examples/15-shadowmaps-simple/shadowmaps_simple.cpp +++ b/examples/15-shadowmaps-simple/shadowmaps_simple.cpp @@ -87,7 +87,7 @@ public: bgfx::setDebug(m_debug); // Uniforms. - s_shadowMap = bgfx::createUniform("s_shadowMap", bgfx::UniformType::Int1); + s_shadowMap = bgfx::createUniform("s_shadowMap", bgfx::UniformType::Sampler); u_lightPos = bgfx::createUniform("u_lightPos", bgfx::UniformType::Vec4); u_lightMtx = bgfx::createUniform("u_lightMtx", bgfx::UniformType::Mat4); diff --git a/examples/16-shadowmaps/shadowmaps.cpp b/examples/16-shadowmaps/shadowmaps.cpp index 10a492787..511714cc7 100644 --- a/examples/16-shadowmaps/shadowmaps.cpp +++ b/examples/16-shadowmaps/shadowmaps.cpp @@ -1334,11 +1334,11 @@ public: // Uniforms. s_uniforms.init(); - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); - s_shadowMap[0] = bgfx::createUniform("s_shadowMap0", bgfx::UniformType::Int1); - s_shadowMap[1] = bgfx::createUniform("s_shadowMap1", bgfx::UniformType::Int1); - s_shadowMap[2] = bgfx::createUniform("s_shadowMap2", bgfx::UniformType::Int1); - s_shadowMap[3] = bgfx::createUniform("s_shadowMap3", bgfx::UniformType::Int1); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); + s_shadowMap[0] = bgfx::createUniform("s_shadowMap0", bgfx::UniformType::Sampler); + s_shadowMap[1] = bgfx::createUniform("s_shadowMap1", bgfx::UniformType::Sampler); + s_shadowMap[2] = bgfx::createUniform("s_shadowMap2", bgfx::UniformType::Sampler); + s_shadowMap[3] = bgfx::createUniform("s_shadowMap3", bgfx::UniformType::Sampler); // Programs. s_programs.init(); diff --git a/examples/18-ibl/ibl.cpp b/examples/18-ibl/ibl.cpp index 6a3febb34..718117088 100644 --- a/examples/18-ibl/ibl.cpp +++ b/examples/18-ibl/ibl.cpp @@ -451,8 +451,8 @@ public: u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4); u_flags = bgfx::createUniform("u_flags", bgfx::UniformType::Vec4); u_camPos = bgfx::createUniform("u_camPos", bgfx::UniformType::Vec4); - s_texCube = bgfx::createUniform("s_texCube", bgfx::UniformType::Int1); - s_texCubeIrr = bgfx::createUniform("s_texCubeIrr", bgfx::UniformType::Int1); + s_texCube = bgfx::createUniform("s_texCube", bgfx::UniformType::Sampler); + s_texCubeIrr = bgfx::createUniform("s_texCubeIrr", bgfx::UniformType::Sampler); m_programMesh = loadProgram("vs_ibl_mesh", "fs_ibl_mesh"); m_programSky = loadProgram("vs_ibl_skybox", "fs_ibl_skybox"); diff --git a/examples/19-oit/oit.cpp b/examples/19-oit/oit.cpp index b8660c063..d94908ef2 100644 --- a/examples/19-oit/oit.cpp +++ b/examples/19-oit/oit.cpp @@ -210,8 +210,8 @@ public: m_ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) ); // Create texture sampler uniforms. - s_texColor0 = bgfx::createUniform("s_texColor0", bgfx::UniformType::Int1); - s_texColor1 = bgfx::createUniform("s_texColor1", bgfx::UniformType::Int1); + s_texColor0 = bgfx::createUniform("s_texColor0", bgfx::UniformType::Sampler); + s_texColor1 = bgfx::createUniform("s_texColor1", bgfx::UniformType::Sampler); u_color = bgfx::createUniform("u_color", bgfx::UniformType::Vec4); m_blend = loadProgram("vs_oit", "fs_oit" ); diff --git a/examples/21-deferred/deferred.cpp b/examples/21-deferred/deferred.cpp index cabf846a1..a86042e58 100644 --- a/examples/21-deferred/deferred.cpp +++ b/examples/21-deferred/deferred.cpp @@ -262,13 +262,13 @@ public: m_ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) ); // Create texture sampler uniforms. - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); - s_texNormal = bgfx::createUniform("s_texNormal", bgfx::UniformType::Int1); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); + s_texNormal = bgfx::createUniform("s_texNormal", bgfx::UniformType::Sampler); - s_albedo = bgfx::createUniform("s_albedo", bgfx::UniformType::Int1); - s_normal = bgfx::createUniform("s_normal", bgfx::UniformType::Int1); - s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Int1); - s_light = bgfx::createUniform("s_light", bgfx::UniformType::Int1); + s_albedo = bgfx::createUniform("s_albedo", bgfx::UniformType::Sampler); + s_normal = bgfx::createUniform("s_normal", bgfx::UniformType::Sampler); + s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Sampler); + s_light = bgfx::createUniform("s_light", bgfx::UniformType::Sampler); u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4); u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Vec4); diff --git a/examples/23-vectordisplay/vectordisplay.cpp b/examples/23-vectordisplay/vectordisplay.cpp index e63d156b9..df1795a8a 100644 --- a/examples/23-vectordisplay/vectordisplay.cpp +++ b/examples/23-vectordisplay/vectordisplay.cpp @@ -94,7 +94,7 @@ void VectorDisplay::setup(uint16_t _width, uint16_t _height, uint8_t _view) m_blitShader = loadProgram("vs_vectordisplay_fb", "fs_vectordisplay_blit"); u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4); - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); genLinetex(); diff --git a/examples/27-terrain/terrain.cpp b/examples/27-terrain/terrain.cpp index 152bc5ec2..8fc60a6c4 100644 --- a/examples/27-terrain/terrain.cpp +++ b/examples/27-terrain/terrain.cpp @@ -112,7 +112,7 @@ public: m_dvbh.idx = bgfx::kInvalidHandle; m_dibh.idx = bgfx::kInvalidHandle; m_heightTexture.idx = bgfx::kInvalidHandle; - s_heightTexture = bgfx::createUniform("s_heightTexture", bgfx::UniformType::Int1); + s_heightTexture = bgfx::createUniform("s_heightTexture", bgfx::UniformType::Sampler); m_oldWidth = 0; m_oldHeight = 0; diff --git a/examples/31-rsm/reflectiveshadowmap.cpp b/examples/31-rsm/reflectiveshadowmap.cpp index 21b2ae7dd..8bc4c5d33 100644 --- a/examples/31-rsm/reflectiveshadowmap.cpp +++ b/examples/31-rsm/reflectiveshadowmap.cpp @@ -258,12 +258,12 @@ public: u_rsmAmount = bgfx::createUniform("u_rsmAmount", bgfx::UniformType::Vec4); // How much RSM to use vs directional light // Create texture sampler uniforms (used when we bind textures) - s_normal = bgfx::createUniform("s_normal", bgfx::UniformType::Int1); // Normal gbuffer - s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Int1); // Normal gbuffer - s_color = bgfx::createUniform("s_color", bgfx::UniformType::Int1); // Color (albedo) gbuffer - s_light = bgfx::createUniform("s_light", bgfx::UniformType::Int1); // Light buffer - s_shadowMap = bgfx::createUniform("s_shadowMap", bgfx::UniformType::Int1); // Shadow map - s_rsm = bgfx::createUniform("s_rsm", bgfx::UniformType::Int1); // Reflective shadow map + s_normal = bgfx::createUniform("s_normal", bgfx::UniformType::Sampler); // Normal gbuffer + s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Sampler); // Normal gbuffer + s_color = bgfx::createUniform("s_color", bgfx::UniformType::Sampler); // Color (albedo) gbuffer + s_light = bgfx::createUniform("s_light", bgfx::UniformType::Sampler); // Light buffer + s_shadowMap = bgfx::createUniform("s_shadowMap", bgfx::UniformType::Sampler); // Shadow map + s_rsm = bgfx::createUniform("s_rsm", bgfx::UniformType::Sampler); // Reflective shadow map // Create program from shaders. m_gbufferProgram = loadProgram("vs_rsm_gbuffer", "fs_rsm_gbuffer"); // Gbuffer diff --git a/examples/33-pom/pom.cpp b/examples/33-pom/pom.cpp index 4148c3212..9d0a91cfc 100644 --- a/examples/33-pom/pom.cpp +++ b/examples/33-pom/pom.cpp @@ -155,9 +155,9 @@ public: m_ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) ); // Create texture sampler uniforms. - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); - s_texNormal = bgfx::createUniform("s_texNormal", bgfx::UniformType::Int1); - s_texDepth = bgfx::createUniform("s_texDepth", bgfx::UniformType::Int1); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); + s_texNormal = bgfx::createUniform("s_texNormal", bgfx::UniformType::Sampler); + s_texDepth = bgfx::createUniform("s_texDepth", bgfx::UniformType::Sampler); u_light_pos = bgfx::createUniform("u_light_pos", bgfx::UniformType::Vec4); diff --git a/examples/36-sky/sky.cpp b/examples/36-sky/sky.cpp index 3a43a8e9d..7e78f3bdd 100644 --- a/examples/36-sky/sky.cpp +++ b/examples/36-sky/sky.cpp @@ -447,7 +447,7 @@ namespace m_time = 0.0f; m_timeScale = 1.0f; - s_texLightmap = bgfx::createUniform("s_texLightmap", bgfx::UniformType::Int1); + s_texLightmap = bgfx::createUniform("s_texLightmap", bgfx::UniformType::Sampler); u_sunLuminance = bgfx::createUniform("u_sunLuminance", bgfx::UniformType::Vec4); u_skyLuminanceXYZ = bgfx::createUniform("u_skyLuminanceXYZ", bgfx::UniformType::Vec4); u_skyLuminance = bgfx::createUniform("u_skyLuminance", bgfx::UniformType::Vec4); diff --git a/examples/37-gpudrivenrendering/gpudrivenrendering.cpp b/examples/37-gpudrivenrendering/gpudrivenrendering.cpp index 00283530d..046f88a85 100644 --- a/examples/37-gpudrivenrendering/gpudrivenrendering.cpp +++ b/examples/37-gpudrivenrendering/gpudrivenrendering.cpp @@ -340,7 +340,7 @@ public: u_inputRTSize = bgfx::createUniform("u_inputRTSize", bgfx::UniformType::Vec4); u_cullingConfig = bgfx::createUniform("u_cullingConfig", bgfx::UniformType::Vec4); u_color = bgfx::createUniform("u_color", bgfx::UniformType::Vec4, 32); - s_texOcclusionDepth = bgfx::createUniform("s_texOcclusionDepth", bgfx::UniformType::Int1); + s_texOcclusionDepth = bgfx::createUniform("s_texOcclusionDepth", bgfx::UniformType::Sampler); //create props { diff --git a/examples/38-bloom/bloom.cpp b/examples/38-bloom/bloom.cpp index 87cdb9c2d..1be1d3d46 100644 --- a/examples/38-bloom/bloom.cpp +++ b/examples/38-bloom/bloom.cpp @@ -243,10 +243,10 @@ public: m_ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) ); - s_albedo = bgfx::createUniform("s_albedo", bgfx::UniformType::Int1); - s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Int1); - s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Int1); - s_light = bgfx::createUniform("s_light", bgfx::UniformType::Int1); + s_albedo = bgfx::createUniform("s_albedo", bgfx::UniformType::Sampler); + s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Sampler); + s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Sampler); + s_light = bgfx::createUniform("s_light", bgfx::UniformType::Sampler); u_pixelSize = bgfx::createUniform("u_pixelSize", bgfx::UniformType::Vec4); u_intensity = bgfx::createUniform("u_intensity", bgfx::UniformType::Vec4); u_color = bgfx::createUniform("u_color", bgfx::UniformType::Vec4); diff --git a/examples/39-assao/assao.cpp b/examples/39-assao/assao.cpp index 0cf1d0687..2a1e5d74f 100644 --- a/examples/39-assao/assao.cpp +++ b/examples/39-assao/assao.cpp @@ -296,18 +296,18 @@ namespace m_uniforms.init(); // Create texture sampler uniforms (used when we bind textures) - s_normal = bgfx::createUniform("s_normal", bgfx::UniformType::Int1); // Normal gbuffer - s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Int1); // Normal gbuffer - s_color = bgfx::createUniform("s_color", bgfx::UniformType::Int1); // Color (albedo) gbuffer - s_albedo = bgfx::createUniform("s_albedo", bgfx::UniformType::Int1); + s_normal = bgfx::createUniform("s_normal", bgfx::UniformType::Sampler); // Normal gbuffer + s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Sampler); // Normal gbuffer + s_color = bgfx::createUniform("s_color", bgfx::UniformType::Sampler); // Color (albedo) gbuffer + s_albedo = bgfx::createUniform("s_albedo", bgfx::UniformType::Sampler); - s_ao = bgfx::createUniform("s_ao", bgfx::UniformType::Int1); - s_blurInput = bgfx::createUniform("s_blurInput", bgfx::UniformType::Int1); - s_finalSSAO = bgfx::createUniform("s_finalSSAO", bgfx::UniformType::Int1); - s_depthSource = bgfx::createUniform("s_depthSource", bgfx::UniformType::Int1); - s_viewspaceDepthSource = bgfx::createUniform("s_viewspaceDepthSource", bgfx::UniformType::Int1); - s_viewspaceDepthSourceMirror = bgfx::createUniform("s_viewspaceDepthSourceMirror", bgfx::UniformType::Int1); - s_importanceMap = bgfx::createUniform("s_importanceMap", bgfx::UniformType::Int1); + s_ao = bgfx::createUniform("s_ao", bgfx::UniformType::Sampler); + s_blurInput = bgfx::createUniform("s_blurInput", bgfx::UniformType::Sampler); + s_finalSSAO = bgfx::createUniform("s_finalSSAO", bgfx::UniformType::Sampler); + s_depthSource = bgfx::createUniform("s_depthSource", bgfx::UniformType::Sampler); + s_viewspaceDepthSource = bgfx::createUniform("s_viewspaceDepthSource", bgfx::UniformType::Sampler); + s_viewspaceDepthSourceMirror = bgfx::createUniform("s_viewspaceDepthSourceMirror", bgfx::UniformType::Sampler); + s_importanceMap = bgfx::createUniform("s_importanceMap", bgfx::UniformType::Sampler); // Create program from shaders. m_gbufferProgram = loadProgram("vs_assao_gbuffer", "fs_assao_gbuffer"); // Gbuffer diff --git a/examples/40-svt/vt.cpp b/examples/40-svt/vt.cpp index 4913d1ddb..95f9f41a0 100644 --- a/examples/40-svt/vt.cpp +++ b/examples/40-svt/vt.cpp @@ -871,8 +871,8 @@ VirtualTexture::VirtualTexture(TileDataFile* _tileDataFile, VirtualTextureInfo* // Create uniforms u_vt_settings_1 = bgfx::createUniform("u_vt_settings_1", bgfx::UniformType::Vec4); u_vt_settings_2 = bgfx::createUniform("u_vt_settings_2", bgfx::UniformType::Vec4); - s_vt_page_table = bgfx::createUniform("s_vt_page_table", bgfx::UniformType::Int1); - s_vt_texture_atlas = bgfx::createUniform("s_vt_texture_atlas", bgfx::UniformType::Int1); + s_vt_page_table = bgfx::createUniform("s_vt_page_table", bgfx::UniformType::Sampler); + s_vt_texture_atlas = bgfx::createUniform("s_vt_texture_atlas", bgfx::UniformType::Sampler); } VirtualTexture::~VirtualTexture() diff --git a/examples/common/debugdraw/debugdraw.cpp b/examples/common/debugdraw/debugdraw.cpp index 6981d4646..286600168 100644 --- a/examples/common/debugdraw/debugdraw.cpp +++ b/examples/common/debugdraw/debugdraw.cpp @@ -636,8 +636,8 @@ struct DebugDrawShared , true ); - u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4, 4); - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); + u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4, 4); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); m_texture = bgfx::createTexture2D(SPRITE_TEXTURE_SIZE, SPRITE_TEXTURE_SIZE, false, 1, bgfx::TextureFormat::BGRA8); void* vertices[Mesh::Count] = {}; diff --git a/examples/common/font/text_buffer_manager.cpp b/examples/common/font/text_buffer_manager.cpp index c231a87c5..415f6db29 100644 --- a/examples/common/font/text_buffer_manager.cpp +++ b/examples/common/font/text_buffer_manager.cpp @@ -605,7 +605,7 @@ TextBufferManager::TextBufferManager(FontManager* _fontManager) .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true) .end(); - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); } TextBufferManager::~TextBufferManager() diff --git a/examples/common/imgui/imgui.cpp b/examples/common/imgui/imgui.cpp index 6cd4b13c1..6abe58b08 100644 --- a/examples/common/imgui/imgui.cpp +++ b/examples/common/imgui/imgui.cpp @@ -262,7 +262,7 @@ struct OcornutImguiContext .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true) .end(); - s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Int1); + s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Sampler); uint8_t* data; int32_t width; diff --git a/examples/common/nanovg/nanovg_bgfx.cpp b/examples/common/nanovg/nanovg_bgfx.cpp index cc2789d74..fa4036fcd 100644 --- a/examples/common/nanovg/nanovg_bgfx.cpp +++ b/examples/common/nanovg/nanovg_bgfx.cpp @@ -271,7 +271,7 @@ namespace gl->u_scissorExtScale = bgfx::createUniform("u_scissorExtScale", bgfx::UniformType::Vec4); gl->u_extentRadius = bgfx::createUniform("u_extentRadius", bgfx::UniformType::Vec4); gl->u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4); - gl->s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Int1); + gl->s_tex = bgfx::createUniform("s_tex", bgfx::UniformType::Sampler); if (bgfx::getRendererType() == bgfx::RendererType::Direct3D9) { diff --git a/examples/common/ps/particle_system.cpp b/examples/common/ps/particle_system.cpp index c7a57d5b0..34cc9a81f 100644 --- a/examples/common/ps/particle_system.cpp +++ b/examples/common/ps/particle_system.cpp @@ -453,7 +453,7 @@ namespace ps m_num = 0; - s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); m_texture = bgfx::createTexture2D( SPRITE_TEXTURE_SIZE , SPRITE_TEXTURE_SIZE diff --git a/include/bgfx/bgfx.h b/include/bgfx/bgfx.h index 0d70ffff6..f93a45880 100644 --- a/include/bgfx/bgfx.h +++ b/include/bgfx/bgfx.h @@ -259,12 +259,12 @@ namespace bgfx /// Uniform types: enum Enum { - Int1, //!< Int, used for samplers only. - End, //!< Reserved, do not use. + Sampler, //!< Sampler. + End, //!< Reserved, do not use. - Vec4, //!< 4 floats vector. - Mat3, //!< 3x3 matrix. - Mat4, //!< 4x4 matrix. + Vec4, //!< 4 floats vector. + Mat3, //!< 3x3 matrix. + Mat4, //!< 4x4 matrix. Count }; diff --git a/include/bgfx/c99/bgfx.h b/include/bgfx/c99/bgfx.h index 316693b47..3610a437b 100644 --- a/include/bgfx/c99/bgfx.h +++ b/include/bgfx/c99/bgfx.h @@ -212,7 +212,7 @@ typedef enum bgfx_texture_format typedef enum bgfx_uniform_type { - BGFX_UNIFORM_TYPE_INT1, + BGFX_UNIFORM_TYPE_SAMPLER, BGFX_UNIFORM_TYPE_END, BGFX_UNIFORM_TYPE_VEC4, diff --git a/include/bgfx/defines.h b/include/bgfx/defines.h index c1f466eb7..5e933c3e4 100644 --- a/include/bgfx/defines.h +++ b/include/bgfx/defines.h @@ -6,7 +6,7 @@ #ifndef BGFX_DEFINES_H_HEADER_GUARD #define BGFX_DEFINES_H_HEADER_GUARD -#define BGFX_API_VERSION UINT32_C(91) +#define BGFX_API_VERSION UINT32_C(92) /// Color RGB/alpha/depth write. When it's not specified write will be disabled. #define BGFX_STATE_WRITE_R UINT64_C(0x0000000000000001) //!< Enable R write. diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 9b2537ca7..73e39ccc9 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -2328,7 +2328,7 @@ namespace bgfx if (isValid(_sampler) ) { uint32_t stage = _stage; - setUniform(UniformType::Int1, _sampler, &stage, 1); + setUniform(UniformType::Sampler, _sampler, &stage, 1); } } diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 11b4af251..4c380acb5 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -3242,9 +3242,9 @@ namespace bgfx { namespace d3d11 } break; - CASE_IMPLEMENT_UNIFORM(Int1, I, int); - CASE_IMPLEMENT_UNIFORM(Vec4, F, float); - CASE_IMPLEMENT_UNIFORM(Mat4, F, float); + CASE_IMPLEMENT_UNIFORM(Sampler, I, int); + CASE_IMPLEMENT_UNIFORM(Vec4, F, float); + CASE_IMPLEMENT_UNIFORM(Mat4, F, float); case UniformType::End: break; diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 6971ba8a6..0d147fc08 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -3131,9 +3131,9 @@ namespace bgfx { namespace d3d12 } break; - CASE_IMPLEMENT_UNIFORM(Int1, I, int); - CASE_IMPLEMENT_UNIFORM(Vec4, F, float); - CASE_IMPLEMENT_UNIFORM(Mat4, F, float); + CASE_IMPLEMENT_UNIFORM(Sampler, I, int); + CASE_IMPLEMENT_UNIFORM(Vec4, F, float); + CASE_IMPLEMENT_UNIFORM(Mat4, F, float); case UniformType::End: break; diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index cee5e94ae..25382745c 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -1921,9 +1921,9 @@ namespace bgfx { namespace d3d9 } break; - CASE_IMPLEMENT_UNIFORM(Int1, I, int); - CASE_IMPLEMENT_UNIFORM(Vec4, F, float); - CASE_IMPLEMENT_UNIFORM(Mat4, F, float); + CASE_IMPLEMENT_UNIFORM(Sampler, I, int); + CASE_IMPLEMENT_UNIFORM(Vec4, F, float); + CASE_IMPLEMENT_UNIFORM(Mat4, F, float); case UniformType::End: break; diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 74dac580d..05a7ea8f3 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -3616,16 +3616,8 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) ); switch (type) { -// case ConstantType::Int1: -// { -// int* value = (int*)data; -// BX_TRACE("Int1 sampler %d, loc %d (num %d, copy %d)", *value, loc, num, copy); -// GL_CHECK(glUniform1iv(loc, num, value) ); -// } -// break; - - CASE_IMPLEMENT_UNIFORM(Int1, 1iv, I, int); - CASE_IMPLEMENT_UNIFORM(Vec4, 4fv, F, float); + CASE_IMPLEMENT_UNIFORM(Sampler, 1iv, I, int); + CASE_IMPLEMENT_UNIFORM(Vec4, 4fv, F, float); CASE_IMPLEMENT_UNIFORM_T(Mat3, Matrix3fv, F, float); CASE_IMPLEMENT_UNIFORM_T(Mat4, Matrix4fv, F, float); @@ -4020,7 +4012,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) ); { case GL_INT: case GL_UNSIGNED_INT: - return UniformType::Int1; + return UniformType::Sampler; case GL_FLOAT: case GL_FLOAT_VEC2: @@ -4076,7 +4068,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) ); case GL_IMAGE_CUBE: case GL_INT_IMAGE_CUBE: case GL_UNSIGNED_INT_IMAGE_CUBE: - return UniformType::Int1; + return UniformType::Sampler; }; BX_CHECK(false, "Unrecognized GL type 0x%04x.", _type); diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index be0459809..1804ad41f 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -319,7 +319,7 @@ namespace bgfx { namespace mtl { case MTLDataTypeUInt: case MTLDataTypeInt: - return UniformType::Int1; + return UniformType::Sampler; case MTLDataTypeFloat: case MTLDataTypeFloat2: @@ -1413,9 +1413,9 @@ namespace bgfx { namespace mtl } break; - CASE_IMPLEMENT_UNIFORM(Int1, I, int); - CASE_IMPLEMENT_UNIFORM(Vec4, F, float); - CASE_IMPLEMENT_UNIFORM(Mat4, F, float); + CASE_IMPLEMENT_UNIFORM(Sampler, I, int); + CASE_IMPLEMENT_UNIFORM(Vec4, F, float); + CASE_IMPLEMENT_UNIFORM(Mat4, F, float); case UniformType::End: break; diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp index d4ca7b39a..956271d23 100644 --- a/src/renderer_vk.cpp +++ b/src/renderer_vk.cpp @@ -2873,9 +2873,9 @@ VK_IMPORT_DEVICE } break; - CASE_IMPLEMENT_UNIFORM(Int1, I, int); - CASE_IMPLEMENT_UNIFORM(Vec4, F, float); - CASE_IMPLEMENT_UNIFORM(Mat4, F, float); + CASE_IMPLEMENT_UNIFORM(Sampler, I, int); + CASE_IMPLEMENT_UNIFORM(Vec4, F, float); + CASE_IMPLEMENT_UNIFORM(Mat4, F, float); case UniformType::End: break; diff --git a/tools/shaderc/shaderc_hlsl.cpp b/tools/shaderc/shaderc_hlsl.cpp index 82b7c1e20..a7e3632d4 100644 --- a/tools/shaderc/shaderc_hlsl.cpp +++ b/tools/shaderc/shaderc_hlsl.cpp @@ -213,14 +213,14 @@ namespace bgfx { namespace hlsl static const UniformRemap s_uniformRemap[] = { - { UniformType::Int1, D3D_SVC_SCALAR, D3D_SVT_INT, 0, 0 }, + { UniformType::Sampler, D3D_SVC_SCALAR, D3D_SVT_INT, 0, 0 }, { UniformType::Vec4, D3D_SVC_VECTOR, D3D_SVT_FLOAT, 0, 0 }, { UniformType::Mat3, D3D_SVC_MATRIX_COLUMNS, D3D_SVT_FLOAT, 3, 3 }, { UniformType::Mat4, D3D_SVC_MATRIX_COLUMNS, D3D_SVT_FLOAT, 4, 4 }, - { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLER, 0, 0 }, - { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLER2D, 0, 0 }, - { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLER3D, 0, 0 }, - { UniformType::Int1, D3D_SVC_OBJECT, D3D_SVT_SAMPLERCUBE, 0, 0 }, + { UniformType::Sampler, D3D_SVC_OBJECT, D3D_SVT_SAMPLER, 0, 0 }, + { UniformType::Sampler, D3D_SVC_OBJECT, D3D_SVT_SAMPLER2D, 0, 0 }, + { UniformType::Sampler, D3D_SVC_OBJECT, D3D_SVT_SAMPLER3D, 0, 0 }, + { UniformType::Sampler, D3D_SVC_OBJECT, D3D_SVT_SAMPLERCUBE, 0, 0 }, }; UniformType::Enum findUniformType(const D3D11_SHADER_TYPE_DESC& constDesc) @@ -527,7 +527,7 @@ namespace bgfx { namespace hlsl { Uniform un; un.name.assign(bindDesc.Name, (end.getPtr() - bindDesc.Name) ); - un.type = UniformType::Enum(BGFX_UNIFORM_SAMPLERBIT | UniformType::Int1); + un.type = UniformType::Enum(BGFX_UNIFORM_SAMPLERBIT | UniformType::Sampler); un.num = 1; un.regIndex = uint16_t(bindDesc.BindPoint); un.regCount = uint16_t(bindDesc.BindCount); diff --git a/tools/shaderc/shaderc_spirv.cpp b/tools/shaderc/shaderc_spirv.cpp index 1f2e165de..a853ac4d5 100644 --- a/tools/shaderc/shaderc_spirv.cpp +++ b/tools/shaderc/shaderc_spirv.cpp @@ -742,7 +742,7 @@ namespace bgfx { namespace spirv switch (program->getUniformType(ii)) { case 0x1404: // GL_INT: - un.type = UniformType::Int1; + un.type = UniformType::Sampler; break; case 0x8B52: // GL_FLOAT_VEC4: un.type = UniformType::Vec4; diff --git a/tools/texturev/texturev.cpp b/tools/texturev/texturev.cpp index b88eb0d5a..c9ed9247d 100644 --- a/tools/texturev/texturev.cpp +++ b/tools/texturev/texturev.cpp @@ -1269,7 +1269,7 @@ int _main_(int _argc, char** _argv) const bgfx::Caps* caps = bgfx::getCaps(); bgfx::RendererType::Enum type = caps->rendererType; - bgfx::UniformHandle s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); + bgfx::UniformHandle s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler); bgfx::UniformHandle u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4); bgfx::UniformHandle u_params0 = bgfx::createUniform("u_params0", bgfx::UniformType::Vec4); bgfx::UniformHandle u_params1 = bgfx::createUniform("u_params1", bgfx::UniformType::Vec4);