Renamed UniformType enum Int1 to Sampler.

This commit is contained in:
Бранимир Караџић 2019-01-11 14:14:17 -08:00
parent 6e75f9f663
commit a54f8a3f81
38 changed files with 101 additions and 109 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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");

View File

@ -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" );

View File

@ -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" );

View File

@ -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);

View File

@ -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();

View File

@ -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");

View File

@ -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" );

View File

@ -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);

View File

@ -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();

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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
{

View File

@ -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);

View File

@ -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

View File

@ -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()

View File

@ -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] = {};

View File

@ -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()

View File

@ -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;

View File

@ -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)
{

View File

@ -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

View File

@ -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
};

View File

@ -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,

View File

@ -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.

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);