Skip to content

Commit

Permalink
Fix compilation error of translated GLSL shader.
Browse files Browse the repository at this point in the history
Comparison of uvec2 and int is not possible, explicitly
use a zero-value uvec2.
  • Loading branch information
sephiroth99 committed Dec 7, 2015
1 parent 280c0b3 commit f154b7e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/xenia/gpu/glsl_shader_translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ void GlslShaderTranslator::ProcessTextureFetchInstruction(
case FetchOpcode::kTextureFetch:
switch (instr.dimension) {
case TextureDimension::k1D:
EmitSourceDepth("if (state.texture_samplers[%d] != 0) {\n",
EmitSourceDepth("if (state.texture_samplers[%d] != uvec2(0)) {\n",
instr.operands[1].storage_index);
EmitSourceDepth(
" pv = texture(sampler1D(state.texture_samplers[%d]), "
Expand All @@ -513,7 +513,7 @@ void GlslShaderTranslator::ProcessTextureFetchInstruction(
EmitSourceDepth("}\n");
break;
case TextureDimension::k2D:
EmitSourceDepth("if (state.texture_samplers[%d] != 0) {\n",
EmitSourceDepth("if (state.texture_samplers[%d] != uvec2(0)) {\n",
instr.operands[1].storage_index);
EmitSourceDepth(
" pv = texture(sampler2D(state.texture_samplers[%d]), "
Expand All @@ -524,7 +524,7 @@ void GlslShaderTranslator::ProcessTextureFetchInstruction(
EmitSourceDepth("}\n");
break;
case TextureDimension::k3D:
EmitSourceDepth("if (state.texture_samplers[%d] != 0) {\n",
EmitSourceDepth("if (state.texture_samplers[%d] != uvec2(0)) {\n",
instr.operands[1].storage_index);
EmitSourceDepth(
" pv = texture(sampler3D(state.texture_samplers[%d]), "
Expand All @@ -536,7 +536,7 @@ void GlslShaderTranslator::ProcessTextureFetchInstruction(
break;
case TextureDimension::kCube:
// TODO(benvanik): undo CUBEv logic on t? (s,t,faceid)
EmitSourceDepth("if (state.texture_samplers[%d] != 0) {\n",
EmitSourceDepth("if (state.texture_samplers[%d] != uvec2(0)) {\n",
instr.operands[1].storage_index);
EmitSourceDepth(
" pv = texture(samplerCube(state.texture_samplers[%d]), "
Expand Down

0 comments on commit f154b7e

Please sign in to comment.