compiler: Allow sampler index to be looked up, although bindings not present yet
authorCody Northrop <cody@lunarg.com>
Mon, 20 Oct 2014 22:42:23 +0000 (16:42 -0600)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Fri, 31 Oct 2014 21:29:18 +0000 (15:29 -0600)
icd/intel/CMakeLists.txt
icd/intel/compiler/mesa-utils/src/mesa/program/ir_to_mesa.cpp
icd/intel/compiler/mesa-utils/src/mesa/program/sampler.cpp
icd/intel/compiler/pipeline/brw_fs_visitor.cpp

index 8ca6e5db1675fad1033e83f6848c99c33d950910..7faa6cb5a309fd16d4ca36959ca0d75ad60febb8 100644 (file)
@@ -243,6 +243,8 @@ SET(COMPILER_SOURCES
 
     #compiler/mesa-utils/src/mesa/main/shaderobj.c
 
+    compiler/mesa-utils/src/mesa/program/sampler.cpp
+
     compiler/shader/glsl_glass_manager.cpp
     compiler/shader/glsl_glass_backend_translator.cpp
     compiler/shader/glsl_glass_backend.cpp
index e7e734b016806684586189a6d999beef46981dfe..fa50f91d44420a927b34c77a0e4a24c98d78bccc 100644 (file)
@@ -37,7 +37,7 @@
 #include "ir_uniform.h"
 #include "glsl_types.h"
 #include "glsl_parser_extras.h"
-#include "../glsl/program.h"
+//#include "../glsl/program.h" // LunarG : Removed
 #include "ir_optimization.h"
 #include "ast.h"
 #include "linker.h"
index e6532be84d3e7726aedc852b83ff563de89d1c40..193d2024efa86da350f9ad75102604c2509bb7e0 100644 (file)
@@ -26,7 +26,8 @@
 #include "ir.h"
 #include "glsl_types.h"
 #include "ir_visitor.h"
-#include "../glsl/program.h"
+//#include "../glsl/program.h" // LunarG : Removed
+#include "linker.h" // LunarG : ADD
 #include "program/hash_table.h"
 #include "ir_uniform.h"
 
index f0920f2c7beac72428f21d86c3193ce7caf19383..dc6c2be75aa94a2a2f431cfcc07af718461cf74a 100644 (file)
@@ -1601,16 +1601,14 @@ fs_visitor::visit(ir_texture *ir)
 {
    fs_inst *inst = NULL;
 
-   // LunarG : TODO - hook these values up from descriptor set
-   int sampler = 0; // = _mesa_get_sampler_uniform_value(ir->sampler, shader_prog, prog);
+   int sampler = _mesa_get_sampler_uniform_value(ir->sampler, shader_prog, prog);
 
    /* FINISHME: We're failing to recompile our programs when the sampler is
     * updated.  This only matters for the texture rectangle scale parameters
     * (pre-gen6, or gen6+ with GL_CLAMP).
     */
 
-   // LunarG : TODO - hook these values up from descriptor set
-   int texunit = 0;// = prog->SamplerUnits[sampler];
+   int texunit = prog->SamplerUnits[sampler];
 
    if (ir->op == ir_tg4) {
       /* When tg4 is used with the degenerate ZERO/ONE swizzles, don't bother